package com.zking.frame.LYK;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.List;

public class getselectNumber {

	public List<Integer> getNumber(String cinemaName,String filmName){
		
		Connection conn=JDBC.getConn();
		List<Integer> list= new ArrayList<Integer>();
		String sql="select seatnumber from seat where cinemaname='"+cinemaName+"'and filmname='"+filmName+"'and ispay=1";
		Statement st =null;
		ResultSet rt =null;
		try {
		 st= conn.createStatement();
		rt =st.executeQuery(sql);
			while(rt.next()){
				int number=rt.getInt("seatnumber");
				list.add(number);
			}
			
			
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		finally {
			try {
				st.close();
				rt.close();
			} catch (SQLException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			
		}
		
		
		return list;
	}
}
